<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@page import="com.liuya.safe.model.SafeQuery" %>
<%@ page import="com.liuya.common.I18N" %>
<%
    I18N i18n = I18N.getWebInstance(request);
    SafeQuery node = (SafeQuery) request.getAttribute("node");
    String id = node.getId();
    boolean isLeaf = node.getIsLeaf();
    String name = node.getName();
    String description = node.getDescription();
%>

<%=isLeaf ? i18n.say("Query") : i18n.say("Query_group")%> <i><%=name%>
</i>:<p/>

<%if (id != "0" && id.contains("-")) { %>
The reserved node is not editable.
<% } %>

<%
    if (!isLeaf) {
%>
<a href="javascript:createNode('<%=id%>')"><%=i18n.say("Create") %>
</a>&nbsp;&nbsp;&nbsp;
<% } else { %>
<a href="javascript:copyNode('<%=id%>')"><%=i18n.say("Copy") %>
</a>&nbsp;&nbsp;&nbsp;
<% } %>

<%
    if (id != "0") {
%>
<a href="javascript:deleteNode('<%=id %>')"><%=i18n.say("Delete") %>
</a>&nbsp;&nbsp;&nbsp;
<a href="javascript:modifyNode('<%=id %>')"><%=i18n.say("Edit") %>
</a>&nbsp;&nbsp;&nbsp;
<%
    }
%>

<%
    if (isLeaf && id != "0") {
%>
<a href="/queryPolicy/editPolicy.do?id=<%=id %>"><%=i18n.say("Edit_policy") %>
</a>&nbsp;&nbsp;&nbsp;
<a href="/queryTest/testPolicy.do?id=<%=id %>"><%=i18n.say("Test") %>
</a>
<%
    }
%>